package cn.edu.zut.soft.student.controller.admin.course;

import cn.edu.zut.soft.student.bean.ResultBean;
import cn.edu.zut.soft.student.model.SelectCourseStudents;
import cn.edu.zut.soft.student.model.Student;
import cn.edu.zut.soft.student.service.course.SelectCourseStudentsBo;
import cn.edu.zut.soft.student.service.course.vo.SelectCourseStudentsQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author ChrisPhantom
 * @CreatDate 2021/02/21 22:27
 */

@RestController
@RequestMapping("/admin/api/selectcourse")
public class SelectCourseController {
    @Autowired
    SelectCourseStudentsBo scsb;

    @GetMapping("")
    public ResultBean<List<SelectCourseStudents>> querySelectCourseStudents(SelectCourseStudentsQuery scsq) {
        return new ResultBean<>(scsb.querySelectCourseStudents(scsq));
    }

    @GetMapping("/{courseid}")
    public ResultBean<List<Student>> queryCourseStudents(String courseid) {
        return new ResultBean<>(scsb.queryCourseStudents(courseid));
    }
}
